import React, { memo } from 'react'
import RoomItem from '../room-item/room-item'
import { SelectroomWrapper } from './style'

const SelectRoom = memo((props) => {
  const { roomwidth, list } = props

  return (
    <SelectroomWrapper>
      {list?.length > 0 && list.slice(0, 8).map(m => (<RoomItem roominfo={ m } roomwidth={ roomwidth } key={ m.id }></RoomItem>))}
    </SelectroomWrapper>
  )
})

export default SelectRoom